import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/smart_warehouse/product_entity.dart';
import 'package:enterprise_v6_app/app/data/common/choice_bean.dart';


ProductEntity $ProductEntityFromJson(Map<String, dynamic> json) {
  final ProductEntity productEntity = ProductEntity();
  final double? boxContent = jsonConvert.convert<double>(json['boxContent']);
  if (boxContent != null) {
    productEntity.boxContent = boxContent;
  }
  final int? combinationQuantity = jsonConvert.convert<int>(json['combinationQuantity']);
  if (combinationQuantity != null) {
    productEntity.combinationQuantity = combinationQuantity;
  }
  final String? combinationType = jsonConvert.convert<String>(json['combinationType']);
  if (combinationType != null) {
    productEntity.combinationType = combinationType;
  }
  final String? combinationTypeName = jsonConvert.convert<String>(json['combinationTypeName']);
  if (combinationTypeName != null) {
    productEntity.combinationTypeName = combinationTypeName;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    productEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    productEntity.createBy = createBy;
  }
  final String? createByName = jsonConvert.convert<String>(json['createByName']);
  if (createByName != null) {
    productEntity.createByName = createByName;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    productEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    productEntity.deleted = deleted;
  }
  final double? dosage = jsonConvert.convert<double>(json['dosage']);
  if (dosage != null) {
    productEntity.dosage = dosage;
  }
  final String? firingEffects = jsonConvert.convert<String>(json['firingEffects']);
  if (firingEffects != null) {
    productEntity.firingEffects = firingEffects;
  }
  final String? firingEffectsName = jsonConvert.convert<String>(json['firingEffectsName']);
  if (firingEffectsName != null) {
    productEntity.firingEffectsName = firingEffectsName;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    productEntity.id = id;
  }
  final int? inventory = jsonConvert.convert<int>(json['inventory']);
  if (inventory != null) {
    productEntity.inventory = inventory;
  }
  final int? minStorage = jsonConvert.convert<int>(json['minStorage']);
  if (minStorage != null) {
    productEntity.minStorage = minStorage;
  }
  final int? minimumAgeRequirement = jsonConvert.convert<int>(json['minimumAgeRequirement']);
  if (minimumAgeRequirement != null) {
    productEntity.minimumAgeRequirement = minimumAgeRequirement;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    productEntity.name = name;
  }
  final double? netWeight = jsonConvert.convert<double>(json['netWeight']);
  if (netWeight != null) {
    productEntity.netWeight = netWeight;
  }
  final String? productCategory = jsonConvert.convert<String>(json['productCategory']);
  if (productCategory != null) {
    productEntity.productCategory = productCategory;
  }
  final String? productCategoryName = jsonConvert.convert<String>(json['productCategoryName']);
  if (productCategoryName != null) {
    productEntity.productCategoryName = productCategoryName;
  }
  final String? productLevel = jsonConvert.convert<String>(json['productLevel']);
  if (productLevel != null) {
    productEntity.productLevel = productLevel;
  }
  final String? productLevelName = jsonConvert.convert<String>(json['productLevelName']);
  if (productLevelName != null) {
    productEntity.productLevelName = productLevelName;
  }
  final double? productLong = jsonConvert.convert<double>(json['productLong']);
  if (productLong != null) {
    productEntity.productLong = productLong;
  }
  final String? productSupplier = jsonConvert.convert<String>(json['productSupplier']);
  if (productSupplier != null) {
    productEntity.productSupplier = productSupplier;
  }
  final double? productTall = jsonConvert.convert<double>(json['productTall']);
  if (productTall != null) {
    productEntity.productTall = productTall;
  }
  final double? productWidth = jsonConvert.convert<double>(json['productWidth']);
  if (productWidth != null) {
    productEntity.productWidth = productWidth;
  }
  final String? safeDistance = jsonConvert.convert<String>(json['safeDistance']);
  if (safeDistance != null) {
    productEntity.safeDistance = safeDistance;
  }
  final String? safeDistanceName = jsonConvert.convert<String>(json['safeDistanceName']);
  if (safeDistanceName != null) {
    productEntity.safeDistanceName = safeDistanceName;
  }
  final double? totalDosage = jsonConvert.convert<double>(json['totalDosage']);
  if (totalDosage != null) {
    productEntity.totalDosage = totalDosage;
  }
  final String? videoUrl = jsonConvert.convert<String>(json['videoUrl']);
  if (videoUrl != null) {
    productEntity.videoUrl = videoUrl;
  }
  final double? volume = jsonConvert.convert<double>(json['volume']);
  if (volume != null) {
    productEntity.volume = volume;
  }
  final String? wareHouseName = jsonConvert.convert<String>(json['wareHouseName']);
  if (wareHouseName != null) {
    productEntity.wareHouseName = wareHouseName;
  }
  final String? warehouseId = jsonConvert.convert<String>(json['warehouseId']);
  if (warehouseId != null) {
    productEntity.warehouseId = warehouseId;
  }
  final bool? isChecked = jsonConvert.convert<bool>(json['isChecked']);
  if (isChecked != null) {
    productEntity.isChecked = isChecked;
  }
  return productEntity;
}

Map<String, dynamic> $ProductEntityToJson(ProductEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['boxContent'] = entity.boxContent;
  data['combinationQuantity'] = entity.combinationQuantity;
  data['combinationType'] = entity.combinationType;
  data['combinationTypeName'] = entity.combinationTypeName;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createByName'] = entity.createByName;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['dosage'] = entity.dosage;
  data['firingEffects'] = entity.firingEffects;
  data['firingEffectsName'] = entity.firingEffectsName;
  data['id'] = entity.id;
  data['inventory'] = entity.inventory;
  data['minStorage'] = entity.minStorage;
  data['minimumAgeRequirement'] = entity.minimumAgeRequirement;
  data['name'] = entity.name;
  data['netWeight'] = entity.netWeight;
  data['productCategory'] = entity.productCategory;
  data['productCategoryName'] = entity.productCategoryName;
  data['productLevel'] = entity.productLevel;
  data['productLevelName'] = entity.productLevelName;
  data['productLong'] = entity.productLong;
  data['productSupplier'] = entity.productSupplier;
  data['productTall'] = entity.productTall;
  data['productWidth'] = entity.productWidth;
  data['safeDistance'] = entity.safeDistance;
  data['safeDistanceName'] = entity.safeDistanceName;
  data['totalDosage'] = entity.totalDosage;
  data['videoUrl'] = entity.videoUrl;
  data['volume'] = entity.volume;
  data['wareHouseName'] = entity.wareHouseName;
  data['warehouseId'] = entity.warehouseId;
  data['isChecked'] = entity.isChecked;
  return data;
}

extension ProductEntityExtension on ProductEntity {
  ProductEntity copyWith({
    double? boxContent,
    int? combinationQuantity,
    String? combinationType,
    String? combinationTypeName,
    String? companyCode,
    String? createBy,
    String? createByName,
    String? createDate,
    String? deleted,
    double? dosage,
    String? firingEffects,
    String? firingEffectsName,
    String? id,
    int? inventory,
    int? minStorage,
    int? minimumAgeRequirement,
    String? name,
    double? netWeight,
    String? productCategory,
    String? productCategoryName,
    String? productLevel,
    String? productLevelName,
    double? productLong,
    String? productSupplier,
    double? productTall,
    double? productWidth,
    String? safeDistance,
    String? safeDistanceName,
    double? totalDosage,
    String? videoUrl,
    double? volume,
    String? wareHouseName,
    String? warehouseId,
    bool? isChecked,
  }) {
    return ProductEntity()
      ..boxContent = boxContent ?? this.boxContent
      ..combinationQuantity = combinationQuantity ?? this.combinationQuantity
      ..combinationType = combinationType ?? this.combinationType
      ..combinationTypeName = combinationTypeName ?? this.combinationTypeName
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createByName = createByName ?? this.createByName
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..dosage = dosage ?? this.dosage
      ..firingEffects = firingEffects ?? this.firingEffects
      ..firingEffectsName = firingEffectsName ?? this.firingEffectsName
      ..id = id ?? this.id
      ..inventory = inventory ?? this.inventory
      ..minStorage = minStorage ?? this.minStorage
      ..minimumAgeRequirement = minimumAgeRequirement ?? this.minimumAgeRequirement
      ..name = name ?? this.name
      ..netWeight = netWeight ?? this.netWeight
      ..productCategory = productCategory ?? this.productCategory
      ..productCategoryName = productCategoryName ?? this.productCategoryName
      ..productLevel = productLevel ?? this.productLevel
      ..productLevelName = productLevelName ?? this.productLevelName
      ..productLong = productLong ?? this.productLong
      ..productSupplier = productSupplier ?? this.productSupplier
      ..productTall = productTall ?? this.productTall
      ..productWidth = productWidth ?? this.productWidth
      ..safeDistance = safeDistance ?? this.safeDistance
      ..safeDistanceName = safeDistanceName ?? this.safeDistanceName
      ..totalDosage = totalDosage ?? this.totalDosage
      ..videoUrl = videoUrl ?? this.videoUrl
      ..volume = volume ?? this.volume
      ..wareHouseName = wareHouseName ?? this.wareHouseName
      ..warehouseId = warehouseId ?? this.warehouseId
      ..isChecked = isChecked ?? this.isChecked;
  }
}
